package com.hundsun.cprs.yyt.service.scheduler;

import com.hundsun.cprs.yyt.service.quota.service.QuotaExchangeRecordService;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.io.Serializable;

/**
 * @author herong22384
 * @date 2019/8/12 15:51
 */
@Service("quotaReleaseQuartzService")
public class QuotaReleaseQuartzService  implements Serializable {

    Logger logger = Logger.getLogger(QuotaReleaseQuartzService.class);

    @Autowired
    private QuotaExchangeRecordService recordService;

    public void quotaRelease(){
        try{
            if (logger.isInfoEnabled()) {
                logger.info("配额兑换定时释放开始");
            }

            recordService.unfreezeByQuartz();

            if (logger.isInfoEnabled()) {
                logger.info("配额兑换定时释放结束");
            }
        }catch (Exception e){
            logger.error("配额兑换定时释放失败：" + e.getMessage());
        }
    }
}
